<?php
class person
{
    public $name;
    public $age;
    public $sex;

    public function qwe($n, $a, $s)
    {
        $this -> name = $n;
        $this -> sex = $s;
        $this -> age = $a;
        $this->say();
    }

    public function say()
    {

        echo '姓名'.$this-> name.'年龄'.$this-> age .'性别'.$this->sex."<br/>";
    }
    public  function   __set($name, $value)
    {
        // TODO: Implement __set() method.
        if($name=='age'){
            $this->age=(($value<0)?1:$value);
        }
        $this->name=$value;
    }
}
$my=new person();
$my->age="17";
$my->name='lcy';
$my->sex='男';
$my->say();
$my->age=-40;
$my->say();
?>